﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Andon.Utils.Common;

namespace HttpDemo.Web
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string message = string.Empty;
            message = FileUtil.ReadFile(ConfigurationUtil.GetAppSettingValue("path"), System.Text.Encoding.UTF8);
            string[] a = new string[] { "aaa" };
            List<string> messageList = message.Split(new string[1] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList<string>();

            List<show> showList = new List<show>();
            foreach (string str in messageList)
            {
                show showItem = new show();
                string[] nn = str.Split(new char[] { '&' });
                showItem.port = nn[0];
                showItem.Data = nn[1];
                showItem.CreateTime = ConvertUtil.GetDateTime(nn[2]);
                showList.Add(showItem);
            }
            GridView1.DataSource = showList;
            GridView1.DataBind();
        }

        public class show
        {
            public string port { get; set; }
            public string Data { get; set; }
            public DateTime CreateTime { get; set; }
        }
    }
}